using System;
using UnityEngine;

[Serializable]
public class Reward
{
	public RewardGroups rewardGroup;

	public string rewerdID;

	public int rewardAmount;

	public void GiveReward(Vector3 moneyPosition)
	{
		switch (rewardGroup)
		{
		case RewardGroups.Non:
			break;
		case RewardGroups.Cash:
			settings.ShowSpecialLabelWithAnimation(rewardAmount, moneyPosition, false);
			break;
		case RewardGroups.Coins:
			settings.ShowLabelWithAnimation(rewardAmount, moneyPosition, false);
			break;
		case RewardGroups.Product:
			if (MarketController.Instance.GetProduct(rewerdID) != null)
			{
				MarketController.Instance.BuyProduct(rewerdID, true);
			}
			break;
		case RewardGroups.ProductConsumable:
			if (MarketController.Instance.GetProduct(rewerdID) != null)
			{
				MarketController.Instance.BuyProduct(rewerdID, true, rewardAmount);
			}
			break;
		}
	}
}
